<?php
if (!defined('TYPO3_MODE')) {
	die('Access denied.');
}

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
	'Jykj.' . $_EXTKEY,
	'Mail',
	'邮件群发'
);

$composerAutoloadFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath("phpexcel_service").'Resources/Private/Contributed/PHPExcel.php';
require_once($composerAutoloadFile);

$pluginSignature = str_replace('_','',$_EXTKEY) . '_mail';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_mail.xml');

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
	'Jykj.' . $_EXTKEY,
	'Sms',
	'短信群发'
);

$pluginSignature = str_replace('_','',$_EXTKEY) . '_sms';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_sms.xml');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', '群发系统');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_mass_domain_model_mail', 'EXT:mass/Resources/Private/Language/locallang_csh_tx_mass_domain_model_mail.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_mass_domain_model_mail');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_mass_domain_model_sms', 'EXT:mass/Resources/Private/Language/locallang_csh_tx_mass_domain_model_sms.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_mass_domain_model_sms');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_mass_domain_model_log', 'EXT:mass/Resources/Private/Language/locallang_csh_tx_mass_domain_model_log.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_mass_domain_model_log');
